package collection;

import java.util.Arrays;
import java.util.List;

/**
 * 数组转集合
 */
public class ArrayToList {
    public static void main(String[] args) {
        String[] array = {"one", "two", "three", "four", "five"};
        System.out.println("array" + Arrays.toString(array));
        List<String> list = Arrays.asList(array);
        System.out.println("list" + list);
        array[2] = "赋给";
        System.out.println("array" + Arrays.toString(array));
        System.out.println("list" + list);
        list.set(3, "规定");
        System.out.println("array" + Arrays.toString(array));
        System.out.println("list" + list);
        
        list.add("ewopfjqwoieth3r");//编译正常 运行时发生不支持操作异常
    }
}